/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package nsip.components.ds.bi;

/**
 *
 * @author nico.rehwaldt
 */
public class Average extends Metric {
    
    private double sum;
    private int count;

    public Average() {
        this.sum = 0.0;
        this.count = 0;
    }

    @Override
    public void update(double value) {
        sum += value;
        count++;
    }
    
    public double value() {
        return sum / count;
    }
}
